<?php
require_once ('domain/db/DB.php');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Login
 *
 * @author Fabio
 */
class Login 
{
    public function checkLogin()
    {
        if(isset ($_POST['user']))
        {
           $rslt_login = $db->getAuthenticationInfo($_POST['user'], md5($_POST['pwd']));
           if(!$rslt_login)
           {
               $details = mysql_fetch_object($rslt_login);
               //Record wit username and password exist
               //Put data into session
               session_start();
               $_SESSION['Username']=$this->detail->user;
               $_SESSION['SellPoint']=$this->detail->sell_point;
               return true;
           }
           else
           {
               return  false;
           }
        }
    }
    public $detail;
}

$login = new Login();

?>
